package com.myzk.example.service;

import com.myzk.example.base.IAsyncService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

@Service
public class AsyncServiceImpl implements IAsyncService {
	
	private Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	@Async("asyncServiceExecutor")
	public void executeAsync() {
		logger.info("----executeAsync  start----");
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		logger.info("----executeAsync end-----");
	}
}
